package com.world.lzh.controller;

import com.world.lzh.entity.User;
import com.world.lzh.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author lzh
 * @Date 2022/5/14 - 10:48
 * @Description
 * @Version 1.0.0
 **/
@RestController
@RequestMapping("/api")
public class IndexController {

    @Autowired
    private UserService userService;

    @PostMapping("/selectUser")
    public List<User> selectUser(@RequestBody User user) {
        return userService.selectUser(user);
    }

    @PostMapping("/insertUser")
    public String insertUser(@RequestBody User user) {
        return userService.insertUser(user);
    }

    @PostMapping("/updateUser")
    public String updateUser(@RequestBody User user) {
        return userService.updateUser(user);
    }
}
